<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="辖区" prop="xq">
        <el-select v-model="queryParams.xq" placeholder="请选择辖区" clearable size="small">
          <el-option
            v-for="dict in xqOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="组别" prop="zb">
        <el-select v-model="queryParams.zb" placeholder="请选择组别" clearable size="small">
          <el-option
            v-for="dict in zbOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="原土地使用权人" prop="ytdsyqr">
        <el-input
          v-model="queryParams.ytdsyqr"
          placeholder="请输入原土地使用权人"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="位置" prop="wz">
        <el-input
          v-model="queryParams.wz"
          placeholder="请输入位置"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="面积" prop="mj">
        <el-input
          v-model="queryParams.mj"
          placeholder="请输入面积"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="规划用途" prop="ghyt">
        <el-input
          v-model="queryParams.ghyt"
          placeholder="请输入规划用途"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否列入年度储备计划" prop="sflrndcbjh">
        <el-select v-model="queryParams.sflrndcbjh" placeholder="请选择是否列入年度储备计划" clearable size="small">
          <el-option
            v-for="dict in sflrndcbjhOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="土地征转" prop="tdzqqk">
        <el-select v-model="queryParams.tdzqqk" placeholder="请选择土地征转" clearable size="small">
          <el-option
            v-for="dict in tdzqqkOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="土地使用权是否收回" prop="tdsyqsfsh">
        <el-select v-model="queryParams.tdsyqsfsh" placeholder="请选择土地使用权是否收回" clearable size="small">
          <el-option
            v-for="dict in tdsyqsfshOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="注销土地证" prop="zxtdz">
        <el-select v-model="queryParams.zxtdz" placeholder="请选择注销土地证" clearable size="small">
          <el-option
            v-for="dict in zxtdzOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="路网套核" prop="lwth">
        <el-select v-model="queryParams.lwth" placeholder="请选择路网套核" clearable size="small">
          <el-option
            v-for="dict in lwthOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="项目生成" prop="xmsc">
        <el-select v-model="queryParams.xmsc" placeholder="请选择项目生成" clearable size="small">
          <el-option
            v-for="dict in xmscOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="覆矿" prop="fk">
        <el-select v-model="queryParams.fk" placeholder="请选择覆矿" clearable size="small">
          <el-option
            v-for="dict in fkOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="质灾" prop="zz">
        <el-select v-model="queryParams.zz" placeholder="请选择质灾" clearable size="small">
          <el-option
            v-for="dict in zzOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="涝隐" prop="ly">
        <el-select v-model="queryParams.ly" placeholder="请选择涝隐" clearable size="small">
          <el-option
            v-for="dict in lyOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="物勘" prop="wk">
        <el-select v-model="queryParams.wk" placeholder="请选择物勘" clearable size="small">
          <el-option
            v-for="dict in wkOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="壤污" prop="rw">
        <el-select v-model="queryParams.rw" placeholder="请选择壤污" clearable size="small">
          <el-option
            v-for="dict in rwOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="控规编制情况" prop="kgbzqk">
        <el-select v-model="queryParams.kgbzqk" placeholder="请选择控规编制情况" clearable size="small">
          <el-option
            v-for="dict in kgbzqkOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="补偿情况" prop="bcqk">
        <el-select v-model="queryParams.bcqk" placeholder="请选择补偿情况" clearable size="small">
          <el-option
            v-for="dict in bcqkOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="拆迁情况" prop="cqqk">
        <el-select v-model="queryParams.cqqk" placeholder="请选择拆迁情况" clearable size="small">
          <el-option
            v-for="dict in cqqkOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="地下管网核查" prop="dxgwhc">
        <el-select v-model="queryParams.dxgwhc" placeholder="请选择地下管网核查" clearable size="small">
          <el-option
            v-for="dict in dxgwhcOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="垃圾清运" prop="ljqy">
        <el-select v-model="queryParams.ljqy" placeholder="请选择垃圾清运" clearable size="small">
          <el-option
            v-for="dict in ljqyOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="储备合同签订" prop="cbhtqd">
        <el-select v-model="queryParams.cbhtqd" placeholder="请选择储备合同签订" clearable size="small">
          <el-option
            v-for="dict in cbhtqdOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="补偿费支付" prop="bcfzf">
        <el-select v-model="queryParams.bcfzf" placeholder="请选择补偿费支付" clearable size="small">
          <el-option
            v-for="dict in bcfzfOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="成本核算" prop="cbhs">
        <el-select v-model="queryParams.cbhs" placeholder="请选择成本核算" clearable size="small">
          <el-option
            v-for="dict in cbhsOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="边界核查" prop="bjhc">
        <el-select v-model="queryParams.bjhc" placeholder="请选择边界核查" clearable size="small">
          <el-option
            v-for="dict in bjhcOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="提请供地" prop="tqgd">
        <el-select v-model="queryParams.tqgd" placeholder="请选择提请供地" clearable size="small">
          <el-option
            v-for="dict in tqgdOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['zhsc:gztz:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['zhsc:gztz:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['zhsc:gztz:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['zhsc:gztz:export']"
        >导出</el-button>
      </el-col>
	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="gztzList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" prop="id" />
      <el-table-column label="辖区" align="center" prop="xq" :formatter="xqFormat" />
      <el-table-column label="组别" align="center" prop="zb" :formatter="zbFormat" />
      <el-table-column label="原土地使用权人" align="center" prop="ytdsyqr" />
      <el-table-column label="位置" align="center" prop="wz" />
      <el-table-column label="面积" align="center" prop="mj" />
      <el-table-column label="规划用途" align="center" prop="ghyt" />
      <el-table-column label="是否列入年度储备计划" align="center" prop="sflrndcbjh" :formatter="sflrndcbjhFormat" />
      <el-table-column label="土地征转" align="center" prop="tdzqqk" :formatter="tdzqqkFormat" />
      <el-table-column label="土地使用权是否收回" align="center" prop="tdsyqsfsh" :formatter="tdsyqsfshFormat" />
      <el-table-column label="注销土地证" align="center" prop="zxtdz" :formatter="zxtdzFormat" />
      <el-table-column label="路网套核" align="center" prop="lwth" :formatter="lwthFormat" />
      <el-table-column label="项目生成" align="center" prop="xmsc" :formatter="xmscFormat" />
      <el-table-column label="覆矿" align="center" prop="fk" :formatter="fkFormat" />
      <el-table-column label="质灾" align="center" prop="zz" :formatter="zzFormat" />
      <el-table-column label="涝隐" align="center" prop="ly" :formatter="lyFormat" />
      <el-table-column label="物勘" align="center" prop="wk" :formatter="wkFormat" />
      <el-table-column label="壤污" align="center" prop="rw" :formatter="rwFormat" />
      <el-table-column label="控规编制情况" align="center" prop="kgbzqk" :formatter="kgbzqkFormat" />
      <el-table-column label="补偿情况" align="center" prop="bcqk" :formatter="bcqkFormat" />
      <el-table-column label="拆迁情况" align="center" prop="cqqk" :formatter="cqqkFormat" />
      <el-table-column label="地下管网核查" align="center" prop="dxgwhc" :formatter="dxgwhcFormat" />
      <el-table-column label="垃圾清运" align="center" prop="ljqy" :formatter="ljqyFormat" />
      <el-table-column label="储备合同签订" align="center" prop="cbhtqd" :formatter="cbhtqdFormat" />
      <el-table-column label="补偿费支付" align="center" prop="bcfzf" :formatter="bcfzfFormat" />
      <el-table-column label="成本核算" align="center" prop="cbhs" :formatter="cbhsFormat" />
      <el-table-column label="边界核查" align="center" prop="bjhc" :formatter="bjhcFormat" />
      <el-table-column label="提请供地" align="center" prop="tqgd" :formatter="tqgdFormat" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['zhsc:gztz:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['zhsc:gztz:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改工作台账对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="辖区" prop="xq">
          <el-select v-model="form.xq" placeholder="请选择辖区">
            <el-option
              v-for="dict in xqOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="组别" prop="zb">
          <el-select v-model="form.zb" placeholder="请选择组别">
            <el-option
              v-for="dict in zbOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="原土地使用权人" prop="ytdsyqr">
          <el-input v-model="form.ytdsyqr" placeholder="请输入原土地使用权人" />
        </el-form-item>
        <el-form-item label="位置" prop="wz">
          <el-input v-model="form.wz" placeholder="请输入位置" />
        </el-form-item>
        <el-form-item label="面积" prop="mj">
          <el-input v-model="form.mj" placeholder="请输入面积" />
        </el-form-item>
        <el-form-item label="规划用途" prop="ghyt">
          <el-input v-model="form.ghyt" placeholder="请输入规划用途" />
        </el-form-item>
        <el-form-item label="是否列入年度储备计划" prop="sflrndcbjh">
          <el-select v-model="form.sflrndcbjh" placeholder="请选择是否列入年度储备计划">
            <el-option
              v-for="dict in sflrndcbjhOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="土地征转" prop="tdzqqk">
          <el-select v-model="form.tdzqqk" placeholder="请选择土地征转">
            <el-option
              v-for="dict in tdzqqkOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="土地使用权是否收回" prop="tdsyqsfsh">
          <el-select v-model="form.tdsyqsfsh" placeholder="请选择土地使用权是否收回">
            <el-option
              v-for="dict in tdsyqsfshOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="注销土地证" prop="zxtdz">
          <el-select v-model="form.zxtdz" placeholder="请选择注销土地证">
            <el-option
              v-for="dict in zxtdzOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="路网套核" prop="lwth">
          <el-select v-model="form.lwth" placeholder="请选择路网套核">
            <el-option
              v-for="dict in lwthOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="项目生成" prop="xmsc">
          <el-select v-model="form.xmsc" placeholder="请选择项目生成">
            <el-option
              v-for="dict in xmscOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="覆矿" prop="fk">
          <el-select v-model="form.fk" placeholder="请选择覆矿">
            <el-option
              v-for="dict in fkOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="质灾" prop="zz">
          <el-select v-model="form.zz" placeholder="请选择质灾">
            <el-option
              v-for="dict in zzOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="涝隐" prop="ly">
          <el-select v-model="form.ly" placeholder="请选择涝隐">
            <el-option
              v-for="dict in lyOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="物勘" prop="wk">
          <el-select v-model="form.wk" placeholder="请选择物勘">
            <el-option
              v-for="dict in wkOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="壤污" prop="rw">
          <el-select v-model="form.rw" placeholder="请选择壤污">
            <el-option
              v-for="dict in rwOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="控规编制情况" prop="kgbzqk">
          <el-select v-model="form.kgbzqk" placeholder="请选择控规编制情况">
            <el-option
              v-for="dict in kgbzqkOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="补偿情况" prop="bcqk">
          <el-select v-model="form.bcqk" placeholder="请选择补偿情况">
            <el-option
              v-for="dict in bcqkOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="拆迁情况" prop="cqqk">
          <el-select v-model="form.cqqk" placeholder="请选择拆迁情况">
            <el-option
              v-for="dict in cqqkOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="地下管网核查" prop="dxgwhc">
          <el-select v-model="form.dxgwhc" placeholder="请选择地下管网核查">
            <el-option
              v-for="dict in dxgwhcOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="垃圾清运" prop="ljqy">
          <el-select v-model="form.ljqy" placeholder="请选择垃圾清运">
            <el-option
              v-for="dict in ljqyOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="储备合同签订" prop="cbhtqd">
          <el-select v-model="form.cbhtqd" placeholder="请选择储备合同签订">
            <el-option
              v-for="dict in cbhtqdOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="补偿费支付" prop="bcfzf">
          <el-select v-model="form.bcfzf" placeholder="请选择补偿费支付">
            <el-option
              v-for="dict in bcfzfOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="成本核算" prop="cbhs">
          <el-select v-model="form.cbhs" placeholder="请选择成本核算">
            <el-option
              v-for="dict in cbhsOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="边界核查" prop="bjhc">
          <el-select v-model="form.bjhc" placeholder="请选择边界核查">
            <el-option
              v-for="dict in bjhcOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="提请供地" prop="tqgd">
          <el-select v-model="form.tqgd" placeholder="请选择提请供地">
            <el-option
              v-for="dict in tqgdOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listGztz, getGztz, delGztz, addGztz, updateGztz, exportGztz } from "@/api/zhsc/gztz";

export default {
  name: "Gztz",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 工作台账表格数据
      gztzList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 辖区字典
      xqOptions: [],
      // 组别字典
      zbOptions: [],
      // 是否列入年度储备计划字典
      sflrndcbjhOptions: [],
      // 土地征转字典
      tdzqqkOptions: [],
      // 土地使用权是否收回字典
      tdsyqsfshOptions: [],
      // 注销土地证字典
      zxtdzOptions: [],
      // 路网套核字典
      lwthOptions: [],
      // 项目生成字典
      xmscOptions: [],
      // 覆矿字典
      fkOptions: [],
      // 质灾字典
      zzOptions: [],
      // 涝隐字典
      lyOptions: [],
      // 物勘字典
      wkOptions: [],
      // 壤污字典
      rwOptions: [],
      // 控规编制情况字典
      kgbzqkOptions: [],
      // 补偿情况字典
      bcqkOptions: [],
      // 拆迁情况字典
      cqqkOptions: [],
      // 地下管网核查字典
      dxgwhcOptions: [],
      // 垃圾清运字典
      ljqyOptions: [],
      // 储备合同签订字典
      cbhtqdOptions: [],
      // 补偿费支付字典
      bcfzfOptions: [],
      // 成本核算字典
      cbhsOptions: [],
      // 边界核查字典
      bjhcOptions: [],
      // 提请供地字典
      tqgdOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        xq: null,
        zb: null,
        ytdsyqr: null,
        wz: null,
        mj: null,
        ghyt: null,
        sflrndcbjh: null,
        tdzqqk: null,
        tdsyqsfsh: null,
        zxtdz: null,
        lwth: null,
        xmsc: null,
        fk: null,
        zz: null,
        ly: null,
        wk: null,
        rw: null,
        kgbzqk: null,
        bcqk: null,
        cqqk: null,
        dxgwhc: null,
        ljqy: null,
        cbhtqd: null,
        bcfzf: null,
        cbhs: null,
        bjhc: null,
        tqgd: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
    this.getDicts("zhsc_xq").then(response => {
      this.xqOptions = response.data;
    });
    this.getDicts("zhsc_zb").then(response => {
      this.zbOptions = response.data;
    });
    this.getDicts("sys_yes_no").then(response => {
      this.sflrndcbjhOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.tdzqqkOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.tdsyqsfshOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.zxtdzOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.lwthOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.xmscOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.fkOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.zzOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.lyOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.wkOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.rwOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.kgbzqkOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.bcqkOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.cqqkOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.dxgwhcOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.ljqyOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.cbhtqdOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.bcfzfOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.cbhsOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.bjhcOptions = response.data;
    });
    this.getDicts("zhsc_wc").then(response => {
      this.tqgdOptions = response.data;
    });
  },
  methods: {
    /** 查询工作台账列表 */
    getList() {
      this.loading = true;
      listGztz(this.queryParams).then(response => {
        this.gztzList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 辖区字典翻译
    xqFormat(row, column) {
      return this.selectDictLabel(this.xqOptions, row.xq);
    },
    // 组别字典翻译
    zbFormat(row, column) {
      return this.selectDictLabel(this.zbOptions, row.zb);
    },
    // 是否列入年度储备计划字典翻译
    sflrndcbjhFormat(row, column) {
      return this.selectDictLabel(this.sflrndcbjhOptions, row.sflrndcbjh);
    },
    // 土地征转字典翻译
    tdzqqkFormat(row, column) {
      return this.selectDictLabel(this.tdzqqkOptions, row.tdzqqk);
    },
    // 土地使用权是否收回字典翻译
    tdsyqsfshFormat(row, column) {
      return this.selectDictLabel(this.tdsyqsfshOptions, row.tdsyqsfsh);
    },
    // 注销土地证字典翻译
    zxtdzFormat(row, column) {
      return this.selectDictLabel(this.zxtdzOptions, row.zxtdz);
    },
    // 路网套核字典翻译
    lwthFormat(row, column) {
      return this.selectDictLabel(this.lwthOptions, row.lwth);
    },
    // 项目生成字典翻译
    xmscFormat(row, column) {
      return this.selectDictLabel(this.xmscOptions, row.xmsc);
    },
    // 覆矿字典翻译
    fkFormat(row, column) {
      return this.selectDictLabel(this.fkOptions, row.fk);
    },
    // 质灾字典翻译
    zzFormat(row, column) {
      return this.selectDictLabel(this.zzOptions, row.zz);
    },
    // 涝隐字典翻译
    lyFormat(row, column) {
      return this.selectDictLabel(this.lyOptions, row.ly);
    },
    // 物勘字典翻译
    wkFormat(row, column) {
      return this.selectDictLabel(this.wkOptions, row.wk);
    },
    // 壤污字典翻译
    rwFormat(row, column) {
      return this.selectDictLabel(this.rwOptions, row.rw);
    },
    // 控规编制情况字典翻译
    kgbzqkFormat(row, column) {
      return this.selectDictLabel(this.kgbzqkOptions, row.kgbzqk);
    },
    // 补偿情况字典翻译
    bcqkFormat(row, column) {
      return this.selectDictLabel(this.bcqkOptions, row.bcqk);
    },
    // 拆迁情况字典翻译
    cqqkFormat(row, column) {
      return this.selectDictLabel(this.cqqkOptions, row.cqqk);
    },
    // 地下管网核查字典翻译
    dxgwhcFormat(row, column) {
      return this.selectDictLabel(this.dxgwhcOptions, row.dxgwhc);
    },
    // 垃圾清运字典翻译
    ljqyFormat(row, column) {
      return this.selectDictLabel(this.ljqyOptions, row.ljqy);
    },
    // 储备合同签订字典翻译
    cbhtqdFormat(row, column) {
      return this.selectDictLabel(this.cbhtqdOptions, row.cbhtqd);
    },
    // 补偿费支付字典翻译
    bcfzfFormat(row, column) {
      return this.selectDictLabel(this.bcfzfOptions, row.bcfzf);
    },
    // 成本核算字典翻译
    cbhsFormat(row, column) {
      return this.selectDictLabel(this.cbhsOptions, row.cbhs);
    },
    // 边界核查字典翻译
    bjhcFormat(row, column) {
      return this.selectDictLabel(this.bjhcOptions, row.bjhc);
    },
    // 提请供地字典翻译
    tqgdFormat(row, column) {
      return this.selectDictLabel(this.tqgdOptions, row.tqgd);
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        xq: null,
        zb: null,
        ytdsyqr: null,
        wz: null,
        mj: null,
        ghyt: null,
        sflrndcbjh: null,
        tdzqqk: null,
        tdsyqsfsh: null,
        zxtdz: null,
        lwth: null,
        xmsc: null,
        fk: null,
        zz: null,
        ly: null,
        wk: null,
        rw: null,
        kgbzqk: null,
        bcqk: null,
        cqqk: null,
        dxgwhc: null,
        ljqy: null,
        cbhtqd: null,
        bcfzf: null,
        cbhs: null,
        bjhc: null,
        tqgd: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加工作台账";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getGztz(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改工作台账";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateGztz(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addGztz(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm('是否确认删除工作台账编号为"' + ids + '"的数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return delGztz(ids);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有工作台账数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return exportGztz(queryParams);
        }).then(response => {
          this.download(response.msg);
        })
    }
  }
};
</script>
